package abstractFactory;/*
 * @auther 顶风少年
 * @mail dfsn19970313@foxmail.com
 * @date 2019-07-24 12:28
 * @notify
 * @version 1.0
 */

import junit.framework.TestCase;

public class AbstractFactoryTest extends TestCase {
    public void testCreate(){
        TropicalGardener tropicalGardener = new TropicalGardener();
        Fruit fruit1 = tropicalGardener.createFruit("热带水果");
        Veggie veggie1 = tropicalGardener.createVeggie("热带蔬菜");
        assertTrue(fruit1 instanceof TropicalFruit);
        assertTrue(veggie1 instanceof  TropicalVeggie);

        NorthernGardener northernGardener = new NorthernGardener();
        Fruit fruit2 = northernGardener.createFruit("北方水果");
        Veggie veggie2 = northernGardener.createVeggie("北方蔬菜");
        assertTrue(fruit2 instanceof NorthernFruit);
        assertTrue(veggie2 instanceof  NorthernVeggie);

    }
}
